<div class="view-body">
    <div class="view-inner">
        <div class="view-cont system-admin-cont system-corp">
            <header class="view-cont-hd clearfix">
                <!--页面标题-->
                <h2 class="pull-left"><span class="line"></span>组织管理</h2>
                <!--面包屑-->
                <ol class="breadcrumb">
                    <li>
                        <span>首页</span>
                    </li>
                    <li class="active">
                        <strong>组织管理</strong>
                    </li>
                </ol>
            </header>
            <section class="view-cont-bd">
                <div class="row-pane">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <div class="grid-c">
                                <input type="text" class="form-control" placeholder="组织搜索" ng-show="vm.se">
                                <div class="org-tree" style="margin-top: 10px">
                                    <div class="load load-md" ng-if="!vm.isTreeLoad">
                                        <i class="fa fa-spin fa-spinner"></i><span class="load-text">数据加载中...</span>
                                    </div>
                                    <div ng-if="vm.isTreeLoad" ui-tree data-drag-enabled="false">
                                        <ol ui-tree-nodes ng-model="vm.treeNode">
                                            <li class="tree-root active" ng-repeat="node in vm.treeNode track by $index" ui-tree-node data-collapsed="false" ng-include="'nodes_renderer_ajax.html'">
                                            </li>
                                        </ol>
                                    </div>
                                </div>
                            </div>
                            <div class="grid-m">
                                <div class="handle-bar handle-bar-bg margin-bottom-15">
                                    <button class="btn btn-default pull-right" type="button" ng-click="vm.openView('md')"><i class="fa fa-plus"></i>增加组织</button>
                                    <button class="btn btn-default pull-right" type="button" ng-click="vm.goDetail({pid:vm.currentView.parentOrgId,id:vm.currentView.orgId, tab:'info'}, vm.currentView.orgName)"><i class="fa fa-eye"></i>查看详情</button>
                                    <div class="hint hint-inline va-m" ng-class="{show: vm.parentOrgId}">
                                        <span><i class="fa fa-map-marker"></i></span><strong class="margin-left-10" ng-bind-html="vm.currentNode"></strong>
                                    </div>
                                </div>
                                <div class="table-wrap">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th style="width: 15%">名称</th>
                                            <th style="width: 20%">组织编码</th>
                                            <th style="width: 20%">状态</th>
                                            <th style="width: 15%">创建时间</th>
                                            <th style="width: 25%">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr class="empty" ng-if="!vm.dataList.length">
                                            <td colspan="7" class="text-center empty">
                                                <div class="hint">
                                                    <span ng-if="vm.child"><i class="fa fa-exclamation-circle"></i>点击左边文字菜单, 以显示数据</span>
                                                    <span ng-if="!vm.child"><i class="fa fa-exclamation-circle"></i>暂无数据</span>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr ng-if="vm.dataList.length" ng-repeat="item in vm.dataList track by $index">
                                            <td>{{item.orgName}}</td>
                                            <td>{{item.orgCode}}</td>
                                            <td><span class="label label-warning" ng-if="item.statusCd == 'S0X'">{{vm.status[item.statusCd]}}</span><span class="label label-success">{{vm.status[item.statusCd]}}</span></td>
                                            <td>{{item.createDate | date: 'yyyy-MM-d'}}</td>
                                            <td>
                                                <div class="btn-action" ng-hide="item.confirm">
                                                    <button type="button" ng-click="vm.goDetail({pid:item.parentOrgId,id:item.orgId,tab:'info'}, item.orgName)" class="btn btn-default btn-xs"><i class="fa fa-eye"></i>查看</button>
                                                    <button type="button" class="btn btn-danger btn-xs" ng-click="vm.toggleConfirm(item)"><i class="fa fa-trash"></i>删除</button>
                                                </div>
                                                <div class="btn-action" ng-hide="!item.confirm">
                                                    <button class="btn btn-default btn-xs" ng-click="vm.toggleConfirm(item)"><i class="fa fa-times"></i>取消</button>
                                                    <button class="btn btn-primary btn-xs" ng-click="vm.del('org',item.id)"><i class="fa fa-check"></i>确定</button>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="pagination-group" ng-if="vm.pager">
                                    <ui-pagination items-per-page="vm.page.perPage" total-items="vm.page.totalItems" ng-model="vm.page.currentPage" max-size="3" jump-input="true" ng-change="vm.changePage(vm.page.currentPage)"></ui-pagination>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>
</div>
<script type="text/ng-template" id="nodes_renderer_ajax.html">
    <div ui-tree-handle class="tree-node tree-node-content">
        <span data-nodrag class="tree-ico" ng-class="{'tree-folder-o': collapsed, 'tree-folder-open-o': !collapsed, 'tree-file-o': !node.hasChildren }" ng-click="vm.toggleNode(this, node, $event)"></span>
        <a data-nodrag class="tree-node-handle" href="javascript:void(0)" ng-click="vm.selectNode(this, node, $event)">
            <span class="tree-node-name">{{node.orgName}}</span>
        </a>
        <span ng-show="node.loading"><i class="fa fa-spin fa-spinner"></i></span>
    </div>
    <ol class="tree-line" ui-tree-nodes ng-model="node.nodes" ng-if="node.hasChildren" ng-class="{'hidden': collapsed}">
        <li collapsed="true" ng-repeat="node in node.nodes track by $index" ng-class="{'has-child': node.hasChildren}" ui-tree-node ng-include="'nodes_renderer_ajax.html'">
        </li>
    </ol>
</script>